﻿using System;
using System.Collections.Generic;
using CTEM.Controllers.Global;
using CTEM.Controllers.Global;

/// <summary>
/// Entity for table SubcontractorContract
/// </summary>

namespace CTEM.Models
{
    public class CS_SubcontractorContractDTO
    {
        public long SubcontractorContractID { get; set; }
        public string WorkItem { get; set; }
        public long ConstructionID { get; set; }
        public long SubcontractorID { get; set; }
        public string Officer { get; set; }
        public long ContractValues { get; set; }
        public long Disbursed { get; set; }
        public string Description { get; set; }
        public DateTime CommencementDate { get; set; }
        public DateTime CompletionDate { get; set; }
        public string Status { get; set; }
        public double ProgressRate { get; set; }
        public bool IsActive { get; set; }
        public bool IsDelete { get; set; }
        public string CreatedBy { get; set; }
        public DateTime CreatedDate { get; set; }
        public string UpdatedBy { get; set; }
        public DateTime LastUpdated { get; set; }

        public HistoryLevel History { get; set; }

        public CS_SubcontractorContractDTO()
        {
            SubcontractorContractID = 0;
            WorkItem = Constants.EMPTY_TEXT;
            ConstructionID = 0;
            SubcontractorID = 0;
            Officer = Constants.EMPTY_TEXT;
            ContractValues = 0;
            Disbursed = 0;
            Description = Constants.EMPTY_TEXT;
            CommencementDate = DateTime.Today;
            CompletionDate = DateTime.Today;
            Status = Constants.EMPTY_TEXT;
            ProgressRate = 0;
            IsActive = true;
            IsDelete = false;
            CreatedBy = Global.CurrentUser.Username;
            CreatedDate = DateTime.Today;
            UpdatedBy = Global.CurrentUser.Username;
            LastUpdated = DateTime.Today;
        }

        public override bool Equals(object obj)
        {
            if (ReferenceEquals(null, obj)) return false;
            if (ReferenceEquals(this, obj)) return true;
            if (obj.GetType() != typeof(CS_SubcontractorContractDTO)) return false;
            return Equals((CS_SubcontractorContractDTO)obj);
        }

        public bool Equals(CS_SubcontractorContractDTO other)
        {
            if (ReferenceEquals(null, other)) return false;
            if (ReferenceEquals(this, other)) return true;
            return Equals(other.SubcontractorContractID, SubcontractorContractID);
        }

        public static bool operator ==(CS_SubcontractorContractDTO left, CS_SubcontractorContractDTO right)
        {
            return Equals(left, right);
        }

        public static bool operator !=(CS_SubcontractorContractDTO left, CS_SubcontractorContractDTO right)
        {
            return !Equals(left, right);
        }

        public override int GetHashCode()
        {
            return base.GetHashCode();
        }
    }
}